package com.yanqu.road.server.timer.activity;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.server.manger.activity.TradeWarActivityMgr;
import com.yanqu.road.utils.executor.GeneralTask;

public class CrossTradeWarOpenCheckTask extends GeneralTask {
    private boolean isRun = false;
    @Override
    public void doRun() {
        if(!isRun){
            isRun = true;
            ActivityInfo activityInfo = TradeWarActivityMgr.getOpenActivityInfo();
            if(null != activityInfo){
                long nowTime = System.currentTimeMillis() / 1000;
                if(nowTime >= activityInfo.getBeginTime() && nowTime < activityInfo.getEndTime()){
                    TradeWarActivityMgr.initCrossTradeWarUnion(activityInfo);
                }
                TradeWarActivityMgr.firstGetCrossNotice();
            }
            isRun = false;
        }
    }
}